import { Column, Entity, JoinColumn, ManyToOne, PrimaryGeneratedColumn } from 'typeorm'

/*
 * @Author: cl
 * @Description: 关联表实体类
 * @Date: 2023-04-12 16:40:08
 * @LastEditTime: 2023-04-13 08:57:52
 * @FilePath: \jsnode\nestjs\naota\src\tiger\entities\son.entity.ts
 * @LastEditors: cl
 */
import { Tiger } from './tiger.entity'
@Entity()
export class Son {
  @PrimaryGeneratedColumn()
  id: number

  @Column()
  name: string

  @ManyToOne(() => Tiger, (tiger) => tiger.sons)
  @JoinColumn()
  tiger: Tiger
}
